package com.eddy.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
@ConfigurationProperties(prefix = "secret")
public class SecretKey {
    private String encryptKey;
    private String decryptKey;

    public static SecretKey secretKey;
    @PostConstruct
    public void init() {
        secretKey = this;
        secretKey.encryptKey = this.encryptKey;
        secretKey.decryptKey = this.decryptKey;
    }


    public String getEncryptKey() {
        return encryptKey;
    }

    public String getDecryptKey() {
        return decryptKey;
    }

    public void setEncryptKey(String encryptKey) {
        this.encryptKey = encryptKey;
    }

    public void setDecryptKey(String decryptKey) {
        this.decryptKey = decryptKey;
    }

    @Override
    public String toString() {
        return "SecretKey{" +
                "encryptKey='" + encryptKey + '\'' +
                ", decryptKey='" + decryptKey + '\'' +
                '}';
    }
}
